Do not try to display service_label when service has been deleted

Fixes an exception in AgentController#show when the service of an oauthable
agent has been deleted.

Dominik Sander 9 years ago
parent
commit
8252e727a2
1 changed files with 1 additions and 0 deletions
  1. 1 0
      app/helpers/application_helper.rb

+ 1 - 0
app/helpers/application_helper.rb

@@ -80,6 +80,7 @@ module ApplicationHelper
80 80
   end
81 81
 
82 82
   def service_label(service)
83
+    return if service.nil?
83 84
     content_tag :span, [
84 85
       omniauth_provider_icon(service.provider),
85 86
       service_label_text(service)